<!DOCTYPE HTML>
<html lang="pt-br" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<h:head>
	
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<meta name="description" content=""/>
	<meta name="author" content=""/>
	<link rel="icon" type="image/png" href="#{facesContext.externalContext.request.contextPath}/lib/imagem/logomarca.png"/>
	
	<link href="#{facesContext.externalContext.request.contextPath}/lib/css/bootstrap.min.css" rel="stylesheet" media="screen"/>
	<link href="#{facesContext.externalContext.request.contextPath}/lib/css/bootstrap-theme.min.css" rel="stylesheet" media="screen"/>
	<link href="#{facesContext.externalContext.request.contextPath}/lib/css/compra.css" rel="stylesheet" media="screen"/>
	<link href="#{facesContext.externalContext.request.contextPath}/lib/css/picklist.css" rel="stylesheet" media="screen"/>
	
	<title>Dallas Moto Peças - Compra</title>
	<script type="text/javascript">     
		PrimeFaces.locales['pt'] = {  
			closeText: 'Fechar',  
			prevText: 'Anterior',  
			nextText: 'Próximo',  
			currentText: 'Começo',  
			monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],  
			monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', 'Jul','Ago','Set','Out','Nov','Dez'],  
			dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado'],  
			dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],  
			dayNamesMin: ['D','S','T','Q','Q','S','S'],  
			weekHeader: 'Semana',  
			firstDay: 0,  
			isRTL: false,  
			showMonthAfterYear: false,  
			yearSuffix: '',  
			timeOnlyTitle: 'Só Horas',  
			timeText: 'Tempo',  
			hourText: 'Hora',  
			minuteText: 'Minuto',  
			secondText: 'Segundo',  
			ampm: false,  
			month: 'Mês',  
			week: 'Semana',  
			day: 'Dia',  
			allDayText : 'Todo o Dia'  
		};
		 var chartStyle = {  
	             padding:20,  
	             legend: {  
	                 display:"right",  
	                 spacing:10  
	             }  
	         };
		 
		 function desabilitarEnter() 
			{
				var tecla = event.keyCode;
				if (tecla == 13){
					return false;
				}
				return true;
			}
	</script>
	
	<style type="text/css">
     	.ui-layout-north 
     	{
        	z-index:20 !important;
            	overflow:visible !important;;
		}
		.ui-layout-north .ui-layout-unit-content {
        	overflow:visible !important;
       	}
	</style>
		
	</h:head>
	
	<h:body>
	
	<p:ajaxStatus onstart="PF('statusDialog').show();" 
				onsuccess="PF('statusDialog').hide();"/>
	
	<p:dialog modal="true" 
			widgetVar="statusDialog" 
			header="Aguarde"
			resizable="false"   
    		draggable="false" 
    		closable="false">  
    	<p:graphicImage value="/lib/imagem/gif-load.gif" /> 
	</p:dialog>
	
	<h:form id="frmCompra" onkeypress="return desabilitarEnter();">
	<p:growl id="mensagem" showDetail="true" autoUpdate="true" closable="true" />
	<p:layout fullPage="true">
	
		<p:layoutUnit position="north" resizable="false" closable="false" collapsible="false" styleClass="titulo">
			 <h:outputText value="Módulo Compras"/>
		</p:layoutUnit>
		
		<p:layoutUnit position="west" size="180" resizable="false" closable="false" collapsible="false" minSize="100" header="Menu Compras">
			<p:accordionPanel activeIndex="0">
				<p:tab title="Relatórios">
				
					<p:commandLink value="Produtos de Baixo Giro"
								action="#{compraManagerBean.processaMenuCompra(1)}"/>
					
					<br/>
					
					<p:commandLink value="Produtos Sem Giro"
								action="#{compraManagerBean.processaMenuCompra(2)}"/>
					
				</p:tab>
				<p:tab title="Gerenciar Promoção">
				
					<p:commandLink value="Promoção de Produtos"
								action="#{compraManagerBean.processaMenuCompra(14)}"/>
					
					<br/>
					
					<p:commandLink value="Tipo de Promoção"
								action="#{compraManagerBean.processaMenuCompra(15)}"/>
								
					<br/>
					
					<p:commandLink value="Premiação"
								action="#{compraManagerBean.processaMenuCompra(16)}"/>
					
				</p:tab>
				
				
			</p:accordionPanel>
			
			<br/>
			
			<div align="center">
			<p:commandButton value="Sair do Módulo"
							actionListener="#{compraManagerBean.processaMenuCompra(20)}"
		        			styleClass="ui-priority-primary"/>
		    </div>
		</p:layoutUnit>
		
		<p:layoutUnit position="center"> 
           	<ui:insert name="corpo"/>      
    	</p:layoutUnit>
    	
    	<p:layoutUnit position="south" resizable="false" closable="false" collapsible="false" styleClass="rodape">
			Usuário Logado: <h:outputText value="#{usuarioLogado.nomeCompleto}"/>
		</p:layoutUnit>
    	  
	</p:layout>
	
	<ui:insert name="modal"/>
	
	</h:form>  
	</h:body>
</html>